﻿using AutoMapper;
using Catchbase.Service.Config;
using Catchbase.TestTools;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Catchbase.Service.UTest
{
    [TestClass]
    public class MapperTest
    {
    

        [TestInitialize]
        public void InitializeTest()
        {
            var config = new AutoMapperConfiguration();
            config.Configure();
        }

        [TestMethod]
        public void ValidateMappings()
        {
            Mapper.AssertConfigurationIsValid();
        }

        [TestMethod]
        public void MustMapAllClassTypesInModel()
        {
            var catcher = new Catchbase.Model.Catcher();
            var bo = catcher.Map<Catchbase.Model.Catcher, Model.Catcher>();
            bo.MustBeInstanceOf<Model.Catcher>();
            var dto = bo.Map<Model.Catcher, Catchbase.Model.Catcher>();
            dto.MustBeInstanceOf<Catchbase.Model.Catcher>();
        }
    }
}